home *** CD-ROM | disk | FTP | other *** search
- -- FFFFFFF nn --
- -- FF nn --
- -- FF oooo nnnnn nnnnn --
- -- FFFFF oo oo nn nn nn --
- -- FF oo oo nn nn nn --
- -- FF oo oo nn nn nn --
- -- FF oooo nn nn nnn --
-
-
- DDDDD lll dd
- DD DD ll dd
- DD DD oooo ww ww nnnnn ll oooo aaaa ddddd eeee rr rr
- DD DD oo oo ww w ww nn nn ll oo oo aa dd dd ee ee rrr rr
- DD DD oo oo ww w ww nn nn ll oo oo aaaaa dd dd eeeeee rr
- DD DD oo oo wwwwwww nn nn ll oo oo aa aa dd dd ee rr
- DDDDD oooo ww ww nn nn llll oooo aaaaa ddddd eeee rr
-
-
-
- *****************************
-
- (From Archive Volume 2 Number 6, published by Norwich Computer Services
- Address: 18 Mile End Road, Norwich, NR4 7QY. Telephone: (0507) 507057)
-
-
- BBC Compatibility Column (1)
-
- By Richard Averill
-
- Welcome to the first BBC Compatibility Column! This is the forum for
- any information exchange regarding the use of software / hardware from
- Acorn computers such as the BBC model B or BBC Master. If you have
- anything you feel would be applicable to this column, whether ideas or
- large features, please send them to me via Paul at Norwich Computer
- Services (see the address on the back cover of the magazine). We will
- try to fit in as much as possible. If you are sending any discs, then
- please send them in either an Acorn-format DFS, Solidisk double density
- or an ADFS format, though please not the new RISC OS 'E' format!
-
- This month we present an answer to the downloading of fonts. Coming up,
- amongst other things, will be an in-depth discussion on all the various
- BBC emulators for the Archimedes.
-
- Font downloader
-
- We have had many requests from Archimedes users for a way of
- downloading fonts designed with the BBC FontAid package from CJE micros
- (there is an Archimedes version available - see 'Fact File' on the
- inside back cover).
-
- We present here a relocatable module to provide the *DLA command from
- FontAid with a number of enhancements. This is only an update of a
- small part of FontAid : the designer program and downloadable fonts for
- FontAid appear only with FontAid as sold from CJE's, so this module
- will not be of use to anyone not possessing FontAid. Existing BBC
- FontAid users can transfer the fonts to the Archimedes with a suitable
- DFS reader utility (try the Arc-DFS series on Archive Shareware Disc 2
- - there will be an updated version with an on-line manual featuring on
- a future shareware disc!)
-
- Description
-
- The module implements the command *DLA. On the BBC, this was a utility
- that had to be loaded each time a font was required to be downloaded,
- with the command *DLA <name of font file>. As the Archimedes has much
- more memory, a relocatable module has been implemented that offers a
- number of enhancements.
-
- In terms of speed, this module is anywhere upwards of 2 times the speed
- of a BBC when downloading fonts (tested on one of our BBC model B's
- fitted with a Solidisk 8271 DFS : other computers may be slower), with
- this speed gained mainly from the fact that the font is loaded into RAM
- before being sent to the printer, rather than using a byte get
- operation. The main reason for the slow speed is the rate at which the
- printer accepts the data.
-
- The *DLA command can be used in the same way as originally, but the
- command *DLA (without parameters) can be issued, if a font has been
- previously downloaded, to download the previous font which will
- hopefully still exist in the module's workspace. This is useful if
- there are problems with the printer, or if the same font will be
- downloaded more than once.
-
- The use of proportional spacing for the fontaid fonts can improve the
- look of the fonts a lot. This can be activated by adding the switch 'P'
- (ie. just the character P) as the parameter directly after the *DLA.
- For example, the following are all valid calls:
-
- *DLA : download previous font
- *DLA ThisFont : download font file "ThisFont"
- *DLA P : download previous font, set proportional spacing
- *DLA P ThisFont : download file "ThisFont", set proportional spacing
-
- Technical details
-
- To generate the module, RUN the program and enter the filename to save
- the module under (the name "FontModule" will be used if none is given).
-
- In response to the excellent comment from David Leckie (Archive 2.4,
- page 4), here is a pseudo-code listing for the routine called by *DLA.
-
- The listing is indented with control statements (eg. if/endif) enclosed
- in brackets to separate them from other parts of the routine.
-
- (line no's)
-
- (600-620) Exit if no workspace has been allocated for module.
- (660-670) Check for 'P' switch:
- (if set:)
- (750-780) skip over blank spaces to next parameter
- (800-830) send proportional spacing codes to printer :
- vdu 2,1,27,1,112,1,1,3 : see lines 1550-1580
- decrement 'number of parameters variable'
- (endif)
- (870-890) Check 'number of parameters' variable:
- (if equal to zero:) no font has to be downloaded
- (910-940) Check to see if a font has been previously downloaded:
- (if not:)
- (950) make R0 point to error block
- (960-980) load link reg (R14), set oVerflow bit, return to OS
- (endif)
- (if other than zero:) a font must be downloaded if possible
- (1020-1060) find and allocate a handle to the named font file
- (if file does not exist:)
- (1080-1120) make R0 point to error block, set oVerflow, return
- (endif)
- (1150-1210) load file into workspace (See p244-250, PRM for OS_GBPB)
- (1230-1260) set 'file previously downloaded' marker
- (endif)
- (1280-1390) send ready - to - download control codes to printer :
- see lines 1490-1530
- (1410-1520) send font file to printer, each byte prefixed by <1> code
- : next code only sent to printer, not to screen driver.
-
- Listing
-
- 10 REM > DLASource
- 20
- 30 REM Archimedes Font Downloader module
- 40 REM (for FontAid font files)
- 50
- 60 REM (C) Richard Averill, January 1989.
- 70
- 80 IF MODE <18 THEN MODE 0 ELSE MODE 18
- 90 PRINT TAB(15) "Archimedes FontAid font downloader module generator"'
- 100 PRINT TAB(25) "(C) Richard Averill, 1989."'
- 110 PRINT TAB(10) "(from Archive magazine, March 1989 (Volume 2 Number 6))"'
- 120
- 130 DIM code% 4000
- 140 PROCassemble
- 150 INPUT "Filename to save module under (Return=""FontModule"") : " module$
- 160 IF module$="" THEN module$="FontModule"
- 170 SYS "OS_File",&0A,module$,&FFA,0,code%,O%
- 180 PRINT "Module saved as """;module$;""""
- 190
- 200 END
- 210
- 220 DEF PROCassemble
- 230 XWriteI%=&20100
- 240 FOR opt%=4 TO 6 STEP 2
- 250 P%=0:O%=code%
- 260 [ OPT opt%
- 270 EQUD 0
- 280 EQUD ptrinit
- 290 EQUD 0
- 300 EQUD 0
- 310 EQUD strtitle
- 320 EQUD strhelp
- 330 EQUD tblcommands
- 340 EQUS STRING$(20,CHR$(0))
- 350
- 360 .strtitle FNstr("FontDownLoader")
- 370
- 380 .strhelp FNstr("FontDownLoader"+CHR$(9)+"1.00 ("+MID$(TIME$,5,11)+") (C)
- Richard Averill, January 1989.")
- 390
- 400 .ptrinit
- 410 STMFD R13!, {R14}
- 420
- 430 MOV R0, #6
- 440 MOV R3, #8192
- 450 SWI "XOS_Module"
- 460
- 470 BVS init_exit
- 480
- 490 STR R2, [R12]
- 500 MOV R0, #0
- 510 ADD R2, R2, #7168
- 520 STR R0, [R2]
- 530
- 540 SWI "XOS_WriteS"
- 550 FNnla("Font-DownLoader v1.00 (C) Richard Averill, January 1989, installe
- d.")
- 560
- 570 .init_exit LDMFD R13!, {PC}
- 580
- 590 .dla
- 600 LDR R2, [R12]
- 610 CMP R2, #0
- 620 MOVEQS PC, R14
- 630
- 640 STMFD R13!, {R14}
- 650 STMFD R13!, {R2}
- 660 LDRB R2, [R0]
- 670 TST R2, #&20
- 680 BICEQ R2, R2, #&20
- 690 CMP R2, #ASC"P"
- 700 BNE not_proportional
- 710 LDRB R2, [R0, #1]
- 720 CMP R2, #32
- 730 BGT not_proportional
- 740
- 750 .jumpover_loop
- 760 LDRB R2, [R0], #1
- 770 CMP R2, #32
- 780 BLE jumpover_loop
- 790
- 800 STMFD R13!, {R0}
- 810 ADR R0, proportional_codes
- 820 SWI "XOS_Write0"
- 830 LDMFD R13!, {R0}
- 840 SUB R1, R1, #1
- 850
- 860 .not_proportional
- 870 LDMFD R13!, {R2}
- 880 CMP R1, #0
- 890 BNE havetoload
- 900
- 910 LDR R2, [R12]
- 920 ADD R2, R2, #7168
- 930 LDR R2, [R2]
- 940 CMP R2, #0
- 950 ADREQ R0, msg_nofont
- 960 LDMEQFD R13!, {R14}
- 970 ORREQ R14, R14, #(1<<28)
- 980 MOVEQS PC, R14
- 990 B download
- 1000
- 1010 .havetoload
- 1020 MOV R1, R0
- 1030 MOV R0, #&40
- 1040 MOV R2, #0
- 1050
- 1060 SWI "XOS_Find"
- 1070
- 1080 CMP R0, #0
- 1090 ADREQ R0, msg_nofont
- 1100 LDMEQFD R13!, {R14}
- 1110 ORREQ R14, R14, #(1<<28)
- 1120 MOVEQS PC, R14
- 1130
- 1140 .file_found
- 1150 MOV R1, R0
- 1160 MOV R0, #3
- 1170 LDR R2, [R12]
- 1180 MOV R3, #6144
- 1190 MOV R4, #0
- 1200
- 1210 SWI "XOS_GBPB"
- 1220
- 1230 MOV R0, #1
- 1240 LDR R1, [R12]
- 1250 ADD R1, R1, #7168
- 1260 STR R0, [R1]
- 1270
- 1280 .download
- 1290 SWI XWriteI%+2
- 1300
- 1310 ADR R1, pre_dla
- 1320 ADD R2, R1, #14
- 1330 .pre_loop
- 1340 LDRB R0, [R1], #1
- 1350 SWIVC XWriteI%+1
- 1360 SWIVCS "XOS_WriteC"
- 1370 BVS dlaexit
- 1380 CMP R1, R2
- 1390 BLT pre_loop
- 1400
- 1410 LDR R1, [R12]
- 1420 ADD R2, R1, #6144
- 1430 .dla_loop
- 1440 LDRB R0, [R1], #1
- 1450 SWIS XWriteI%+1
- 1460 SWIVCS "XOS_WriteC"
- 1470 BVS dlaexit
- 1480 CMP R1, R2
- 1490 BLT dla_loop
- 1500
- 1510 .dlaexit
- 1520 SWI XWriteI%+3
- 1530 LDMFD R13!, {PC}
- 1540
- 1550 .pre_dla EQUD &251B281B : EQUD &521B0001 : EQUD &261B00 : EQUD &7F00
- 1560
- 1570 .proportional_codes EQUD &011B0102 : EQUD &03010170 : EQUD 0
- 1580
- 1590 .msg_nofont
- 1600 EQUD &D6 : FNstr("Font file not found")
- 1610
- 1620 .tblcommands
- 1630 FNstr("DLA")
- 1640 EQUD dla : EQUD &20100 : EQUD syndla : EQUD hlpdla : EQUD 0
- 1650
- 1660 .hlpdla
- 1670 EQUS "Font-DownLoader, (C) Richard Anthony Averill, January 1989."+CHR$
- (13)+CHR$(13)
- 1680 EQUS "*DLA downloads FontAid font files to Canon-type NLQ printers."+CH
- R$(13)
- 1690 EQUS "The P prefix, when present, causes proportional spacing to be ena
- bled."+CHR$(13)
- 1700 EQUS "If no font file is given, the previous downloaded font will be re-
- downloaded."+CHR$(13)
- 1710 .syndla
- 1720 FNstr("Syntax: *DLA [P] [<font file>].")
- 1730 ]
- 1740 NEXT opt%
- 1750 ENDPROC
- 1760
- 1770 DEF FNstr(str$)
- 1780 [ OPT opt% AND &E
- 1790 EQUS str$ + CHR$(0)
- 1800 ALIGN
- 1810 ] :=opt%
- 1820
- 1830 DEF FNnla(str$)
- 1840 [ OPT opt% AND &E
- 1850 EQUS str$ + CHR$(10) + CHR$(13) + CHR$(0)
- 1860 ALIGN
- 1870 ] :=opt%
-
- Listing
-
- 10 REM > DLASource
- 20
- 30 REM Archimedes Font Downloader module
- 40 REM (for FontAid font files)
- 50
- 60 REM (C) Richard Averill, January 1989.
- 70
- 80 IF MODE <18 THEN MODE 0 ELSE MODE 18
- 90 PRINT TAB(15) "Archimedes FontAid font downloader module generator"'
- 100 PRINT TAB(25) "(C) Richard Averill, 1989."'
- 110 PRINT TAB(10) "(from Archive magazine, March 1989 (Volume 2 Number 6))"'
- 120
- 130 DIM code% 4000
- 140 PRINT "Assembling code ...";:PROCassemble:PRINT '
- 150 INPUT "Filename to save module under (Return=""FontModule"") : " module$
- 160 IF module$="" THEN module$="FontModule"
- 170 SYS "OS_File",&0A,module$,&FFA,0,code%,O%
- 180 PRINT "Module saved as """;module$;""""
- 190
- 200 END
- 210
- 220 DEF PROCassemble
- 230 sp=13 : link=14 : pc=15:XWriteI%=&20100
- 240 FOR opt%=4 TO 6 STEP 2
- 250 P%=0:O%=code%
- 260 [ OPT opt%
- 270 equd 0
- 280 equd ptrinit
- 290 equd 0
- 300 equd 0
- 310 equd strtitle
- 320 equd strhelp
- 330 equd tblcommands
- 340 equs STRING$(20,CHR$(0))
- 350
- 360 .strtitle FNstr("FontDownLoader")
- 370
- 380 .strhelp FNstr("FontDownLoader"+CHR$(9)+"1.00 ("+MID$(TIME$,5,11)+") (C) Richard Averill, January 1989.")
- 390
- 400 .ptrinit
- 410 stmfd (sp)!, {link}
- 420
- 430 mov r0, #6
- 440 mov r3, #8192
- 450 swi "XOS_Module"
- 460
- 470 bvs init_exit
- 480
- 490 str r2, [r12]
- 500 mov r2, #0
- 510 add r2, r2, #7168
- 520 str r0, [r2]
- 530
- 540 swi "XOS_WriteS"
- 550 FNnla( "Font-DownLoader v1.00 (C) Richard Averill, January 1989, installed.")
- 560
- 570 .init_exit ldmfd (sp)!, {pc}
- 580
- 590 .dla
- 600 ldr r2, [r12]
- 610 cmp r2, #0
- 620 moveqs pc, link
- 630
- 640 stmfd (sp)!, {link}
- 650 stmfd (sp)!, {r2}
- 660 ldrb r2, [r0]
- 670 tst r2, #&20
- 680 biceq r2, r2, #&20
- 690 cmp r2, #ASC("P")
- 700 bne not_proportional
- 710 ldrb r2, [r0, #1]
- 720 cmp r2, #32
- 730 bgt not_proportional
- 740
- 750 .jumpover_loop
- 760 ldrb r2, [r0], #1
- 770 cmp r2, #32
- 780 ble jumpover_loop
- 790
- 800 stmfd (sp)!, {r0}
- 810 adr r0, proportional_codes
- 820 swi "XOS_Write0"
- 830 ldmfd (sp)!, {r0}
- 840 sub r1, r1, #1
- 850
- 860 .not_proportional
- 870 ldmfd (sp)!, {r2}
- 880 cmp r1, #0
- 890 bne havetoload
- 900
- 910 ldr r2, [r12]
- 920 add r2, r2, #7168
- 930 ldr r2, [r2]
- 940 cmp r2, #0
- 950 adreq r0, msg_nofont
- 960 ldmeqfd (sp)!, {link}
- 970 orreq link, link, #(1<<28)
- 980 moveqs pc, link
- 990 b download
- 1000
- 1010 .havetoload
- 1020 mov r1, r0
- 1030 mov r0, #&40
- 1040 mov r2, #0
- 1050
- 1060 swi "XOS_Find"
- 1070
- 1080 cmp r0, #0
- 1090 adreq r0, msg_nofont
- 1100 ldmeqfd (sp)!, {link}
- 1110 orreq link, link, #(1<<28)
- 1120 moveqs pc, link
- 1130
- 1140 .file_found
- 1150 mov r1, r0
- 1160 mov r0, #3
- 1170 ldr r2, [r12]
- 1180 mov r3, #6144
- 1190 mov r4, #0
- 1200
- 1210 swi "XOS_GBPB"
- 1220
- 1230 mov r0, #1
- 1240 ldr r1, [r12]
- 1250 add r1, r1, #7168
- 1260 str r0, [r1]
- 1270
- 1280 .download
- 1290 swi XWriteI%+2
- 1300
- 1310 adr r1, pre_dla
- 1320 add r2, r1, #14
- 1330 .pre_loop
- 1340 ldrb r0, [r1], #1
- 1350 swivc XWriteI%+1
- 1360 swivcs "XOS_WriteC"
- 1370 bvs dlaexit
- 1380 cmp r1, r2
- 1390 blt pre_loop
- 1400
- 1410 ldr r1, [r12]
- 1420 add r2, r1, #6144
- 1430 .dla_loop
- 1440 ldrb r0, [r1], #1
- 1450 swis XWriteI%+1
- 1460 swivcs "XOS_WriteC"
- 1470 bvs dlaexit
- 1480 cmp r1, r2
- 1490 blt dla_loop
- 1500
- 1510 .dlaexit
- 1520 swi XWriteI%+3
- 1530 LDMFD (sp)!, {pc}
- 1540
- 1550 .pre_dla equd &251B281B : equd &521B0001 : equd &261B00 : equd &7F00
- 1560
- 1570 .proportional_codes equd &011B0102 : equd &03010170 : equd 0
- 1580
- 1590 .msg_nofont
- 1600 equd &D6 : FNstr("Font file not found")
- 1610
- 1620 .tblcommands
- 1630 FNstr("DLA")
- 1640 equd dla : equd &20100 : equd syndla : equd hlpdla : equd 0
- 1650
- 1660 .hlpdla
- 1670 equs "Font-DownLoader, (C) Richard Anthony Averill, January 1989."+CHR$(13)+CHR$(13)
- 1680 equs "*DLA downloads FontAid font files to Canon-type NLQ printers."+CHR$(13)
- 1690 equs "The P prefix, when present, causes proportional spacing to be enabled."+CHR$(13)
- 1700 equs "If no font file is given, the previous downloaded font will be re-downloaded."+CHR$(13)
- 1710 .syndla
- 1720 FNstr("Syntax: *DLA [P] [<font file>].")
- 1730 ]
- 1740 NEXT opt%
- 1750 ENDPROC
- 1760
- 1770 DEF FNstr(str$)
- 1780 [ OPT opt% AND &E
- 1790 equs str$ + CHR$(0)
- 1800 align
- 1810 ] :=opt%
- 1820
- 1830 DEF FNnla(str$)
- 1840 [ OPT opt% AND &E
- 1850 equs str$ + CHR$(10) + CHR$(13) + CHR$(0)
- 1860 align
- 1870 ] :=opt%
-